package cn.edu.ecust.service.achievement;

import cn.edu.ecust.common.util.Resp;
import cn.edu.ecust.mapper.achievement.AchievementProjectMapper;
import cn.edu.ecust.po.achievement.AchievementProject;
import cn.edu.ecust.po.achievement.ProjectPageBean;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AchievementProjectService {
    @Resource
    private AchievementProjectMapper achievementProjectMapper;
    public Resp page(Integer page, Integer pageSize) {
        long count = achievementProjectMapper.count();
        Integer start = (page - 1) * pageSize;
        List<AchievementProject> list = achievementProjectMapper.list(start, pageSize);
        ProjectPageBean projectPageBean = new ProjectPageBean(count, list);
        return new Resp<>("200", "请求成功", projectPageBean);
    }

    // @Resource
    //private ProPgBeMapper;
}
